﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

using Electronic_work_order.Interfacess.OA_travel_on_business_LEI;
using Electronic_work_order.Model;



namespace Electronic_work_order.Controllers
{
    // [Route("api/[controller]")]
    [ApiController]
    public class OA_travel_LEIController : ControllerBase
    {
        private readonly Itravel_on_business itravel_On_Business;

        public OA_travel_LEIController(Itravel_on_business itravel_On_Business)
        {
            this.itravel_On_Business = itravel_On_Business;
        }

        [HttpPost]
        [Route("[controller]/AddTB")]
        public int AddTB(travel_on_business tb)
        {
            if (itravel_On_Business.AddItravel_on_business(tb) > 0)
            {
                return 1;
            }
            else
            {
                return 0;
            }
        }
    }
}
